<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增列字段的验证规则')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-rules-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否必填(1是)：</label>
                <div class="col-sm-8">
                    <input name="isRequired" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证数字(1是)：</label>
                <div class="col-sm-8">
                    <input name="isNumber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证整数(1是)：</label>
                <div class="col-sm-8">
                    <input name="isInteger" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">验证最小值(1是)：</label>
                <div class="col-sm-8">
                    <input name="minValue" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">验证最大值(1是)：</label>
                <div class="col-sm-8">
                    <input name="maxValue" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是邮箱(1是)：</label>
                <div class="col-sm-8">
                    <input name="isEmail" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是否是有效的网址(1是)：</label>
                <div class="col-sm-8">
                    <input name="isUrl" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是日期(1是)：</label>
                <div class="col-sm-8">
                    <input name="isDate" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是时间(1是)：</label>
                <div class="col-sm-8">
                    <input name="isTime" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">自定义的验证函数：</label>
                <div class="col-sm-8">
                    <input name="func" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: bootstrap-table" />
    <script th:inline="javascript">
        var prefix = ctx + "dynamic/rules"
        $("#form-rules-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-rules-add').serialize());
            }
        }
    </script>
</body>
</html>